package LeetCode;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * @author VX5
 * @Title: MJC
 * @ProjectName DataStructure
 * @Description: TODO
 * @date ${DAT}15:04
 */
public class interview59II {
    public static void main(String[] args) {
        String s = "abcdefg";
        System.out.println(new interview59II().reverseLeftWords(s,2));
    }

    public String reverseLeftWords(String s, int n) {
        char[] arr = new char[s.length()];
        int index = 0;
        for (int i = n; i < s.length(); i++){
            arr[index++] = s.charAt(i);
        }
        for (int i = 0; i < n; i++){
            arr[index++] = s.charAt(i);
        }
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = 0; i< arr.length; i++){
            stringBuffer.append(arr[i]);
        }
        return stringBuffer.toString();
    }
}
